<template>
  <!-- <audio controls >
    <source :src="musicURL" type="audio/mp3" />
  </audio>-->
<vue-plyr>
  <audio controls playsinline :src="musicURL" ref="audioRef">
  </audio>
</vue-plyr>

</template>

<script lang="ts" setup>
import { useStore } from '@/store';
import { ref, onMounted, watchEffect } from 'vue';
import emitterPlay from "@/utils/mittEvent";


const musicURL = ref('')


emitterPlay.all.clear();

emitterPlay.on("play", (URL) => {
  musicURL.value = URL as string

});

const props = withDefaults(
  defineProps<{
    URL?: string
  }>(), {
  URL: ''
})

const audioRef = ref<HTMLElement | null>(null)

//
// watchEffect(() => {

// })


</script>
<style lang="less" scoped>
audio {
  color: rgb(182, 29, 29);
}
</style>
